float4x4 matViewProjection;
texture tex;

struct VS_INPUT 
{
   float4 Position : POSITION0;
   
};

struct VS_OUTPUT 
{
   float4 Position : POSITION0;
   float3 tex:TEXCOORD0;
};

VS_OUTPUT main( VS_INPUT Input )
{
   VS_OUTPUT Output;

   Output.Position = mul( Input.Position,matViewProjection );
   Output.tex=normalize(Input.Position.yzx);
   
   return( Output )
   
}

sampler Texture0=sampler_state
{
	texture=<tex>;
	MipFilter=LINEAR;
	MinFilter=LINEAR;
	MagFilter=LINEAR;
};

float4 ps_main(float3 tex:TEXCOORD0) : COLOR0
{   
   return texCUBE(Texture0,tex);
   
}

technique SimpleSkyBox
{
	pass p0
		{
		 	Lighting=false;
			Cullmode=none;
			AlphaBlendEnable = false;
			AlphaTestEnable = false;

			ZENABLE = true;
			ZWRITEENABLE = true;
			
			
			StencilEnable = true;
			StencilFunc = always;
			StencilPass = replace;
			StencilRef = 0;

		        vertexshader=compile vs_1_1 main();
	                pixelshader=compile ps_1_1 ps_main();
		}
}
